package com.ruoyi.controller;

import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrderController extends BaseController {
    @Autowired
    private OrderService orderService;

    /**
     * 查询订单
     */
    @RequestMapping("/list")
    public AjaxResult order(@RequestParam("userId") Long userId)  {
        return AjaxResult.success(orderService.getByUserId(userId));
    }
}
